package kuoge.practice.concurrent.netty;

import io.netty.channel.EventLoop;
import io.netty.channel.nio.NioEventLoopGroup;

public class NettyTest {
    public static void main(String[] args) throws InterruptedException {
        final NioEventLoopGroup eventLoopGroup = new NioEventLoopGroup(4);
        final EventLoop eventLoop = eventLoopGroup.next();
        eventLoop.execute(() -> {
            System.out.println(Thread.currentThread().getName());
        });

        Thread.sleep(10000);

        eventLoop.execute(() -> {
            System.out.println(Thread.currentThread().getName());
        });

        eventLoopGroup.shutdownGracefully();
    }
}
